package com.colombounplug.geoshopper;

import android.app.Activity;
import android.app.TabActivity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.widget.FrameLayout;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;

/**
 * Main class that contains the tab host its the container for all the tabs.
 * @author anuradha.uduwage
 *
 */
public class GeoShopperMain extends TabActivity {
	
	TabHost mTabHost;
	FrameLayout mFrameLayout;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        //Tab host is the container for all the tabs
        mTabHost = getTabHost();
        TabSpec tabSpec = mTabHost.newTabSpec("tabItemList");
        tabSpec.setIndicator("Item List");
        Context context = this.getApplicationContext();
        Intent intent = new Intent(context, ShoppingListTab.class);
        tabSpec.setContent(intent);
        mTabHost.addTab(tabSpec);
        
       //map tab
        TabSpec tabSpecMap = mTabHost.newTabSpec("tabMapView");
        tabSpecMap.setIndicator("Map View");
        Context mapContext = this.getApplicationContext();
        Intent mapIntent = new Intent(mapContext, MapTabView.class);
        tabSpecMap.setContent(mapIntent);
        mTabHost.addTab(tabSpecMap);
        
        //google shopping tab
        TabSpec tabSpecCompare = mTabHost.newTabSpec("tabCompareView");
        tabSpecCompare.setIndicator("Compare");
        Context compareContext = this.getApplicationContext();
        Intent compareIntent = new Intent(compareContext, CompareItemTab.class);
        tabSpecCompare.setContent(compareIntent);
        mTabHost.addTab(tabSpecCompare);
        mTabHost.setCurrentTab(0);
    }
}